package biz.innovasoft.nodb.transaction;

import java.util.Date;

import org.prevayler.Transaction;

import biz.innovasoft.nodb.impl.GenericRepository;

public class RemoveUpdateValidatorTransaction implements Transaction {

	private static final long serialVersionUID = 1L;
	
	private final String validatorName;
	private final Class<?> clazz;
	
	public RemoveUpdateValidatorTransaction(String validatorName, Class<?> clazz) {
		this.validatorName = validatorName;
		this.clazz = clazz;
	}

	@Override
	public void executeOn(Object prevalentSystem, Date time) {
		GenericRepository repository = (GenericRepository)prevalentSystem;
		repository.removeUpdateValidator(validatorName, clazz);
	}

}
